package com.lmf.cloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Description TODO
 * <p>
 * Copyright @2022 Shanghai Mise Co. Ltd.
 * All right reserved.
 * <p>
 * @Author LiuMingFu
 * @Date 2024/7/22 22:45
 */
@Configuration
public class LoadBalancerConfig {
    
    
    //手动重新注入restTemplate模板类，否则无法使用负载均衡
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate()
    {
        return new RestTemplate();
    }
}
